package message.server;

import entity.ChessUser;
import message.BaseMessage;
import socket.ChessClient;

/**
 * 进入房间报文.
 *
 * @author 张紘溢
 */
public class ServerEnterRoomMessage extends BaseMessage {
    private int roomId;
    private boolean isLeft;
    private ChessUser chessUser;

    public ServerEnterRoomMessage(int roomId, boolean isLeft, ChessUser chessUser) {
        this.roomId = roomId;
        this.chessUser = chessUser;
        this.isLeft = isLeft;
    }

    @Override
    public void sendToServer() {

    }

    @Override
    public void selfExecute() {
        ChessClient.getInstance().getRoomList().toRoom(roomId, isLeft, chessUser);
    }
}
